package cn.tedu.spring.config;

import cn.tedu.spring.eg1.Prodect;
import cn.tedu.spring.example.User;
import cn.tedu.spring.fail.Database;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestSpringConfig {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext
                (SpringConfig.class);
        Database database = context.getBean(Database.class);
        System.out.println(database);
        User user = context.getBean(User.class);
        System.out.println(user);
        Prodect prodect = context.getBean(Prodect.class);
        System.out.println(prodect);

    }
}
